<?php
/**
 *  💡 免责声明：本软件不得用于商业用途，仅做学习交流
 *  ⚠️ 权利声明：本软件由版权人提供产品技术支持
 *  📅 项目编号：NX2025-0135
 */
namespace App\Api\Controllers\Commons;

use App\Api\BaseApi;
use App\Models\CombustionRecord;
use App\Models\DailyBeanReleases;

class DataAnalysisApi extends BaseApi
{
    public function dataAnalysis() //数据分析
    {
        $bean = DailyBeanReleases::query()->where('id', '>', 5)->sum('beans_released');
        $c = CombustionRecord::query()->sum('quantity');
        return responses([
            //            'totalSales' => $total_beans,
            'totalOutput' => $bean,
            'totalRelease' => $c,
        ]);
    }
}
